package com.feng.cloud.system.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.feng.cloud.system.entity.RoleMenu;
import com.feng.cloud.system.mapper.RoleMenuMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName RoleMenuService
 * @Description TODO
 * @Author Better Feng
 * @Date 2019/12/28 22:24
 * @Version 1.0
 **/
@Service
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
@AllArgsConstructor
public class RoleMenuService extends ServiceImpl<RoleMenuMapper, RoleMenu> {

    public void deleteRoleMenusByRoleIds(List<String> idList) {
        this.baseMapper.delete(new LambdaQueryWrapper<RoleMenu>().in(RoleMenu::getRoleId, idList));
    }
}
